package com.company.nuwa.redis.common;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;

import java.time.Duration;

/**
 * <p>description</p >
 *
 * @author youyoukele
 * @version 1.0
 * @date 2021/7/9
 */
@Data
@Accessors(chain = true)
public class RedisConfiguration {

    /**
     * Entry expiration. By default the entries never expire.
     */
    private Duration timeToLive;

    /**
     * Allow caching null values.
     */
    private boolean cacheNullValues = true;

    /**
     * Key prefix.
     */
    private String keyPrefix;

    /**
     * Whether to use the key prefix when writing to Redis.
     */
    private boolean useKeyPrefix = true;

    /**
     * object cache redis serializer
     */
    private GenericJackson2JsonRedisSerializer objectCacheRedisSerializer;

}
